/*==============================================

Library:   CTK

Copyright (c) 2010  Kitware Inc.

Licensed under the Apache License, Version 2.0
you may not use this file except in compliance
You may obtain a copy of the License at

http://www.commontk.org/LICENSE

Unless required by applicable law or agreed to
distributed under the License is distributed o
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
See the License for the specific language gove
limitations under the License.

================================================ */

#ifndef __ctkRangeSlider_h
#define __ctkRangeSlider_h

// Qt includes
#include <QSlider>

// CTK includes
#include <ctkPimpl.h>

// #include "CTKWidgetsExport.h"

class QStylePainter;
class ctkRangeSliderPrivate;

//class CTK_WIDGETS_EXPORT ctkRangeSlider : public
class ctkRangeSlider : public QSlider
{
	Q_OBJECT
	Q_PROPERTY(int minimumValue READ minimumValue WRITE setMinimumValue)
	Q_PROPERTY(int maximumValue READ maximumValue WRITE setMaximumValue)
	Q_PROPERTY(int minimumPosition READ minimumPosition WRITE setMinimumPosition)
	Q_PROPERTY(int maximumPosition READ maximumPosition WRITE setMaximumPosition)

public:
	// Superclass typedef
	typedef QSlider Superclass;
	// Constructors
	explicit ctkRangeSlider( Qt::Orientation o, QWidget* par= 0 );
	explicit ctkRangeSlider( QWidget* par = 0 );
	virtual ~ctkRangeSlider();

	int minimumValue() const;
	int maximumValue() const;

	int minimumPosition() const;
	void setMinimumPosition(int min);

	int maximumPosition() const;
	void setMaximumPosition(int max);

	void setPositions(int min, int max);

signals:
	void minimumValueChanged(int min);
	void maximumValueChanged(int max);
	void valuesChanged(int min, int max);

	void minimumPositionChanged(int min);

	void maximumPositionChanged(int max);

	void positionsChanged(int min, int max);

public slots:
		void setMinimumValue(int min);
		void setMaximumValue(int max);
		void setValues(int min, int max);
protected slots:
			void onRangeChanged(int minimum, int maximum);

protected:
	// Description:
	// Standard Qt UI events
	virtual void mousePressEvent(QMouseEvent* ev);
	virtual void mouseMoveEvent(QMouseEvent* ev);
	virtual void mouseReleaseEvent(QMouseEvent* ev);

	// Description:
	// Rendering is done here.
	virtual void paintEvent(QPaintEvent* ev);

private:
	CTK_DECLARE_PRIVATE(ctkRangeSlider);
};

#endif
